import java.util.Arrays;

public class Test02 {
    public static void main(String[] args) {
        //数组普通查找
        int [] array = {1,2,3,4,5};
        for (int i = 0; i < array.length; i++) {
            if (array[i] == 3){
                System.out.println("找到了，下标为：" + i);
                break;
            }
        }
        //数组二分查找
        int [] array1 = {1,2,3,4,5};
        int index = Arrays.binarySearch(array1, 3);
        System.out.println(index);
        System.out.println(Arrays.binarySearch(array1, 6));

    }
}
